package com.steven.ourcontest.login.api

import com.steven.ourcontest.login.bean.CodeResponse
import com.steven.ourcontest.login.bean.LoginResponse
import com.steven.ourcontest.login.bean.SignUpResponse
import com.steven.ourcontest.net.BaseResponse
import io.reactivex.Observable
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST

interface LoginApiService {

    @FormUrlEncoded
    @POST("/auth/sendCode")
    fun sendCode(
        @Field("email") email: String,
        @Field("code") code: Int
    ): Observable<BaseResponse<CodeResponse>>

    @FormUrlEncoded
    @POST("/auth/loginQuick")
    fun quickLogin(@Field("email") email: String): Observable<BaseResponse<LoginResponse>>

    @FormUrlEncoded
    @POST("/auth/login")
    fun login(
        @Field("email") email: String,
        @Field("password") password: String
    ): Observable<BaseResponse<LoginResponse>>

    @FormUrlEncoded
    @POST("/auth/signUp")
    fun signUp(
        @Field("email") email: String,
        @Field("password") password: String
    ): Observable<BaseResponse<SignUpResponse>>
}